﻿/*********************弘石项目三组************************
*  功能描述：绩效管理：按钮项目考核控制器
*  作者：刘伟康
*  时间：2021-12-13
*  修改人：刘伟康
*  修改时间：2021-12-13
*********************弘石项目三组************************/
using Hong.Business.Business_AssessmentManagement;
using Hong.Model.SysDomain.Model_AssessmentManagement;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WeHongshibApI.Controllers.Controllers_AssessmentManagement
{
    [ApiExplorerSettings(GroupName = "Assessment")]
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AssProjectController : ControllerBase
    {
        #region 构造器注入
        private readonly AssmentProjectBusiness _dal;
        public AssProjectController(AssmentProjectBusiness dal)
        {
            _dal = dal;
        }
        #endregion
        #region 考核项目
        #region 大考核项目
        /// <summary>
        /// 大考核项目的显示
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetAssessmentPrjec(string id)
        {
            var list = _dal.GetAssessmentPrjec(id);
            return Ok(list);
        }
        #endregion

        #region 小考核项目
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="ass"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddAssSmaliProjec(AssSmaliProjec ass)
        {
            var i = _dal.AddAssSmaliProjec(ass);
            return Ok(i);
        }
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetAssSmaliProjecFT(int id)
        {
            var list = _dal.GetAssSmaliProjecFT(id);
            return Ok(list);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpPut]
        public IActionResult PutAssSmaliProjec(AssSmaliProjec ass)
        {

            return Ok(_dal.PutAssSmaliProjec(ass));
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpDelete]
        public IActionResult DelAssSmaliProjec(int id)
        {
            var i = _dal.DelAssSmaliProjec(id);

            return Ok(i);
        }
        /// <summary>
        /// 显示小项目考核
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetViewAssClassSmali(string ids)
        {

            return Ok(_dal.GetViewAssClassSmali(ids));
        }
        #endregion

        #region 考核分类
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="ass"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddAssClass(AssClass ass)
        {
            var i = _dal.AddAssClass(ass);
            return Ok(i);
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetAssClass(int ids)
        {
            var list = _dal.GetAssClass(ids);
            return Ok(list);
        }
        /// <summary>
        /// 反填
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetAssClassFT(int id)
        {
            var list = _dal.GetAssClassFT(id);
            return Ok(list);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        [HttpPut]
        public IActionResult PutAssClass(AssClass ass)
        {

            return Ok(_dal.PutAssClass(ass));
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <returns></returns>
        [HttpDelete]
        public IActionResult DelAssClass(int id)
        {
            var i = _dal.DelAssClass(id);

            return Ok(i);
        }
        #endregion
        #endregion

    }
}
